package com.huawang.mdesign.model.service.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;
import lombok.Data;
import java.util.List;

/**
 * @author lvh
 * @description 图例模版VO
 * @date 2024/12/27 17:39:15
 */
@Data
@Builder
@Schema(title = "图例模版VO")
public class LegendTemplateVo {
    @Schema(title = "元素类型模版")
    private ElementTypeTemplateVo elementTypeTemplateVo;
    @Schema(title = "元素构造型上定义的属性模版")
    private ElementStereotypeParamTemplateVo elementStereotypeParamTemplateVo;
    @Schema(title = "构造型相关模版")
    private StereotypeTemplateVo stereotypeTemplateVo;
    @Schema(title = "端口类型模版")
    private PortTypeTemplateVo portTypeTemplateVo;
    @Schema(title = "部件类型模版")
    private PartTypeTemplateVo partTypeTemplateVo;
    @Schema(title = "端口类型构造型/部件类型构造型-模版")
    private TypeStereotypeTemplateVo typeStereotypeTemplateVo;

    @Data
    @Builder
    @Schema(title = "端口类型构造型/部件类型构造型模版")
    public static class TypeStereotypeTemplateVo {
        @Schema(title = "元素类型:表达式")
        @Builder.Default
        private String typeStereotypeExpression = "{\"projectId\":null,\"tableId\":null,\"customizeColumnName\":null,\"customizeColumnId\":null,\"customizeColumnType\":null,\"isValueOrdered\":false,\"isValueUnique\":false,\"scripts\":[],\"simpleNavigations\":[],\"metachainNavigations\":[],\"impliedRelations\":[],\"findNavigations\":[],\"unionNavigations\":[],\"countNavigations\":[],\"valueNavigations\":[],\"typeEvaluateNavigations\":[{\"operationType\":\"TypeEvaluateNavigation\",\"key\":null,\"style\":null,\"label\":\"类型判断\",\"enLabel\":\"\",\"argName\":\"\",\"operationName\":\"类型判断\",\"input\":{\"operationType\":\"MetachainNavigation\",\"key\":null,\"style\":{\"color\":\"#BDC6D0\",\"strokeDasharray\":\"\"},\"label\":\"链式关系\",\"enLabel\":null,\"argName\":\"\",\"operationName\":\"链式关系\",\"context\":null,\"resultFilterTypes\":[],\"isDisplay\":true,\"chain\":[{\"type\":\"metaclass\",\"metaClassId\":\"Property\",\"propertyKey\":\"TypedElement-type\",\"propertyName\":\"类型\"}]},\"filterTypes\":{\"metaClasses\":[],\"stereotypes\":[\"#{id}\"],\"basicTypes\":[]},\"isTypeAccurateMatch\":false,\"isContainSubClass\":false}],\"propertyEvaluateNavigations\":[],\"excludeNavigations\":[],\"filterNavigations\":[],\"defaultContextNavigations\":[],\"simpleNavigationCollections\":[]}";
        @Schema(title = "端口类型构造型")
        private List<unifiedParam> portTypeStereotypeIds;
        @Schema(title = "部件类型构造型")
        private List<unifiedParam> partTypeStereotypeIds;
    }

    @Data
    @Builder
    @Schema(title = "端口类型模版")
    public static class PortTypeTemplateVo {
        @Schema(title = "元素类型:表达式")
        @Builder.Default
        private String typeExpression = "{\"projectId\":null,\"tableId\":null,\"customizeColumnName\":null,\"customizeColumnId\":null,\"customizeColumnType\":null,\"isValueOrdered\":false,\"isValueUnique\":false,\"scripts\":[{\"operationType\":\"Script\",\"key\":null,\"style\":null,\"label\":\"脚本\",\"enLabel\":null,\"argName\":\"\",\"operationName\":\"脚本\",\"scriptName\":null,\"scriptType\":\"JavaScript\",\"scriptContent\":\"arg1==arg2\",\"scriptArgs\":null,\"mapOperationList\":[{\"operationType\":\"MetachainNavigation\",\"key\":null,\"style\":{\"color\":\"#BDC6D0\",\"strokeDasharray\":\"\"},\"label\":\"链式关系\",\"enLabel\":null,\"argName\":\"arg1\",\"operationName\":\"链式关系\",\"context\":null,\"resultFilterTypes\":[],\"isDisplay\":true,\"chain\":[{\"type\":\"metaclass\",\"metaClassId\":\"Port\",\"propertyKey\":\"TypedElement-type\",\"propertyName\":\"类型\"},{\"type\":\"metaclass\",\"metaClassId\":\"Type\",\"propertyKey\":\"NamedElement-qualifiedName\",\"propertyName\":\"限定名称\"}]},{\"operationType\":\"MetachainNavigation\",\"key\":\"1LRNQ17-Rx-9\",\"style\":{\"color\":\"#BDC6D0\",\"strokeDasharray\":\"\"},\"label\":\"链式关系\",\"enLabel\":null,\"argName\":\"arg2\",\"operationName\":\"链式关系\",\"context\":{\"operationType\":\"ValueNavigation\",\"key\":null,\"style\":null,\"label\":\"元素\",\"enLabel\":null,\"argName\":\"\",\"operationName\":\"元素\",\"valueType\":\"Instance\",\"value\":\"#{id}\"},\"resultFilterTypes\":[],\"isDisplay\":true,\"chain\":[{\"type\":\"metaclass\",\"metaClassId\":\"NamedElement\",\"propertyKey\":\"NamedElement-qualifiedName\",\"propertyName\":\"限定名称\"}]}],\"resultFilterTypes\":[]}],\"simpleNavigations\":[],\"metachainNavigations\":[],\"impliedRelations\":[],\"findNavigations\":[],\"unionNavigations\":[],\"countNavigations\":[],\"valueNavigations\":[],\"typeEvaluateNavigations\":[],\"propertyEvaluateNavigations\":[],\"excludeNavigations\":[],\"filterNavigations\":[],\"defaultContextNavigations\":[],\"simpleNavigationCollections\":[]}";
        @Schema(title = "端口类型")
        private List<unifiedParam> portTypeIds;
    }

    @Data
    @Builder
    @Schema(title = "部件类型模版")
    public static class PartTypeTemplateVo {
        @Schema(title = "元素类型:表达式")
        @Builder.Default
        private String typeExpression = "{\"projectId\":null,\"tableId\":null,\"customizeColumnName\":null,\"customizeColumnId\":null,\"customizeColumnType\":null,\"isValueOrdered\":false,\"isValueUnique\":false,\"scripts\":[{\"operationType\":\"Script\",\"key\":null,\"style\":null,\"label\":\"脚本\",\"enLabel\":null,\"argName\":\"\",\"operationName\":\"脚本\",\"scriptName\":null,\"scriptType\":\"JavaScript\",\"scriptContent\":\"arg1==arg2\",\"scriptArgs\":null,\"mapOperationList\":[{\"operationType\":\"MetachainNavigation\",\"key\":null,\"style\":{\"color\":\"#BDC6D0\",\"strokeDasharray\":\"\"},\"label\":\"链式关系\",\"enLabel\":null,\"argName\":\"arg1\",\"operationName\":\"链式关系\",\"context\":null,\"resultFilterTypes\":[],\"isDisplay\":true,\"chain\":[{\"type\":\"metaclass\",\"metaClassId\":\"Property\",\"propertyKey\":\"TypedElement-type\",\"propertyName\":\"类型\"},{\"type\":\"metaclass\",\"metaClassId\":\"Type\",\"propertyKey\":\"NamedElement-qualifiedName\",\"propertyName\":\"限定名称\"}]},{\"operationType\":\"MetachainNavigation\",\"key\":\"1LRNQ17-Rx-9\",\"style\":{\"color\":\"#BDC6D0\",\"strokeDasharray\":\"\"},\"label\":\"链式关系\",\"enLabel\":null,\"argName\":\"arg2\",\"operationName\":\"链式关系\",\"context\":{\"operationType\":\"ValueNavigation\",\"key\":null,\"style\":null,\"label\":\"元素\",\"enLabel\":null,\"argName\":\"\",\"operationName\":\"元素\",\"valueType\":\"Instance\",\"value\":\"#{id}\"},\"resultFilterTypes\":[],\"isDisplay\":true,\"chain\":[{\"type\":\"metaclass\",\"metaClassId\":\"NamedElement\",\"propertyKey\":\"NamedElement-qualifiedName\",\"propertyName\":\"限定名称\"}]}],\"resultFilterTypes\":[]}],\"simpleNavigations\":[],\"metachainNavigations\":[],\"impliedRelations\":[],\"findNavigations\":[],\"unionNavigations\":[],\"countNavigations\":[],\"valueNavigations\":[],\"typeEvaluateNavigations\":[],\"propertyEvaluateNavigations\":[],\"excludeNavigations\":[],\"filterNavigations\":[],\"defaultContextNavigations\":[],\"simpleNavigationCollections\":[]}";
        @Schema(title = "部件类型")
        private List<unifiedParam> partTypeIds;
    }


    @Data
    @Builder
    @Schema(title = "构造型相关模版")
    public static class StereotypeTemplateVo {
        @Schema(title = "元素类型:表达式")
        @Builder.Default
        private String stereotypeExpression = "{\"projectId\":null,\"tableId\":null,\"customizeColumnName\":null,\"customizeColumnId\":null,\"customizeColumnType\":null,\"isValueOrdered\":false,\"isValueUnique\":false,\"scripts\":[],\"simpleNavigations\":[],\"metachainNavigations\":[],\"impliedRelations\":[],\"findNavigations\":[],\"unionNavigations\":[],\"countNavigations\":[],\"valueNavigations\":[],\"typeEvaluateNavigations\":[{\"operationType\":\"TypeEvaluateNavigation\",\"key\":null,\"style\":null,\"label\":\"类型判断\",\"enLabel\":\"\",\"argName\":\"\",\"operationName\":\"类型判断\",\"input\":null,\"filterTypes\":{\"metaClasses\":[],\"stereotypes\":[],\"basicTypes\":[]},\"isTypeAccurateMatch\":false,\"isContainSubClass\":false}],\"propertyEvaluateNavigations\":[],\"excludeNavigations\":[],\"filterNavigations\":[],\"defaultContextNavigations\":[],\"simpleNavigationCollections\":[]}";
        @Schema(title = "端口构造型")
        private List<unifiedParam> portStereotypeIds;
        @Schema(title = "部件构造型")
        private List<unifiedParam> partStereotypeIds;
        @Schema(title = "连接器构造型")
        private List<unifiedParam> connectorStereotypeIds;
    }
    // 内部类 Element
    @Data
    @Builder
    @Schema(title = "元素类型模版")
    public static class ElementTypeTemplateVo {
        @Schema(title = "元素类型:表达式")
        @Builder.Default
        private String elementTypeExpression = "{\"projectId\":null,\"tableId\":null,\"customizeColumnName\":null,\"customizeColumnId\":null,\"customizeColumnType\":null,\"isValueOrdered\":false,\"isValueUnique\":false,\"scripts\":[],\"simpleNavigations\":[],\"metachainNavigations\":[],\"impliedRelations\":[],\"findNavigations\":[],\"unionNavigations\":[],\"countNavigations\":[],\"valueNavigations\":[],\"typeEvaluateNavigations\":[{\"operationType\":\"TypeEvaluateNavigation\",\"key\":null,\"style\":null,\"label\":\"类型判断\",\"enLabel\":\"\",\"argName\":\"\",\"operationName\":\"类型判断\",\"input\":null,\"filterTypes\":{\"metaClasses\":[],\"stereotypes\":[],\"basicTypes\":[]},\"isTypeAccurateMatch\":false,\"isContainSubClass\":false}],\"propertyEvaluateNavigations\":[],\"excludeNavigations\":[],\"filterNavigations\":[],\"defaultContextNavigations\":[],\"simpleNavigationCollections\":[]}";
        @Schema(title = "元素类型:有构造型取构造性Id")
        private List<unifiedParam> stereotypeIds;
        @Schema(title = "元素类型:无构造型取元类Id")
        private List<unifiedParam> mateClassIds;
    }
    @Data
    @Builder
    @Schema(title = "元素构造型上定义的属性模版")
    public static class ElementStereotypeParamTemplateVo {
        @Schema(title = "元素构造型属性:表达式")
        @Builder.Default
        private String elementStereotypeParamExpression = "{\"projectId\":null,\"tableId\":null,\"customizeColumnName\":null,\"customizeColumnId\":null,\"customizeColumnType\":null,\"isValueOrdered\":false,\"isValueUnique\":false,\"scripts\":[],\"simpleNavigations\":[],\"metachainNavigations\":[],\"impliedRelations\":[],\"findNavigations\":[],\"unionNavigations\":[],\"countNavigations\":[],\"valueNavigations\":[],\"typeEvaluateNavigations\":[],\"propertyEvaluateNavigations\":[{\"operationType\":\"PropertyEvaluateNavigation\",\"key\":null,\"style\":null,\"label\":\"属性判断\",\"enLabel\":\"\",\"argName\":\"\",\"operationName\":\"属性判断\",\"input\":{\"operationType\":\"DefaultContextNavigation\",\"key\":\"1PKMvda-91-5\",\"style\":{\"color\":null,\"strokeDasharray\":null},\"label\":\"This\",\"enLabel\":\"\",\"argName\":\"\",\"operationName\":\"This\",\"contextName\":null},\"filterTypes\":{\"metaClasses\":[],\"stereotypes\":[],\"basicTypes\":[]},\"propertyGroups\":[{\"metaclass\":null,\"propertyName\":null,\"propertyValue\":null,\"propertyValues\":[],\"dataType\":null,\"isMultiplicity\":false}],\"isPropertyAccurateMatch\":false}],\"excludeNavigations\":[],\"filterNavigations\":[],\"defaultContextNavigations\":[],\"simpleNavigationCollections\":[]}";
        @Schema(title = "布尔类型属性List")
        private List<unifiedParam> booleanTypeIds;
        @Schema(title = "枚举类型属性List")
        private List<unifiedParam> enumTypeIds;
    }

    @Data
    @Builder
    @Schema(title = "统一格式")
    public static class unifiedParam {
        @Schema(title = "当前对象id")
        private String id;
        @Schema(title = "名称")
        private String name;
        @Schema(title = "构造型id，构造型参数使用")
        private String stereotypeId;
        @Schema(title = "模型id")
        private String modelId;
    }
}
